This program works properly but i got bit confused on some point...
Code:
#include <stdio.h>
#include <stdlib.h>
#define MAXSTRING 100
int main(void) {
char c ='a', *p, s[MAXSTRING];
p = &c;
printf("%c%c%c%c ", *p, *p + 1, *p+2);
strcpy(s, "ABC");
printf("%s %c%c %c\n", s, *s+6, *s+7, s+1);
strcpy(s, "she sells sea shells by the seashore");
p = s + 14;
for (; *p != '\0'; ++p) {
if ( *p == 'e')
*p = 'E';
if ( *p == ' ')
*p = '\n';
}
printf("%s\n", s);
return 0;
}
The output will be
abc ABC GHBC
.....
...
..
And if i made some changes on the char s that i remove the pointer
Code:
strcpy(s, "ABC");
printf("%s %c%c%s\n", s, s+6, s+7, s+1);
the output will be
ABC FGBC
here's the problem..it looks like the start counting with 1..issit true..n didn't it suppose to be same answer as above?I will appreciate everuthing if u guys help me...thanks